package models

type GeneratorTemplate struct {
	Id         *int            `json:"id" gorm:"primary_key;auto_increment"`
	CreateTime *LocalTime      `json:"createTime" gorm:"type:timestamp;autoCreateTime"`
	UpdateTime *LocalTime      `json:"updateTime" gorm:"type:datetime;autoUpdateTime"`
	CreateBy   *int            `json:"createBy"`
	DelBy      *int            `json:"delBy"`
	Del        *bool           `json:"del"`
	Remark     *string         `json:"remark"`
	Title      *string         `json:"title"`    //标题
	UseCount   *int            `json:"useCount"` //使用次数
	Files      []GeneratorFile `json:"files"`    //模板文件
}

type GeneratorFile struct {
	Id                  *int       `json:"id" gorm:"primary_key;auto_increment"`
	CreateTime          *LocalTime `json:"createTime" gorm:"type:timestamp;autoCreateTime"`
	UpdateTime          *LocalTime `json:"updateTime" gorm:"type:datetime;autoUpdateTime"`
	CreateBy            *int       `json:"createBy"`
	DelBy               *int       `json:"delBy"`
	Del                 *bool      `json:"del"`
	Remark              *string    `json:"remark"`
	Content             *string    `json:"content" gorm:"type:longtext"` //模板内容
	FileName            *string    `json:"fileName"`                     //文件名称
	Language            *string    `json:"language"`                     //文件语言
	GeneratorTemplateId *int       `json:"generatorTemplateId"`
}

func (g *GeneratorTemplate) TableName() string {
	return "generator_template"
}

func (f *GeneratorFile) TableName() string {
	return "generator_file"
}

func init() {
	//registerContainer["generator_template"] = &GeneratorTemplate{}
	//registerContainer["generator_file"] = &GeneratorFile{}
	registerContainer = append(registerContainer, &GeneratorFile{})
	registerContainer = append(registerContainer, &GeneratorTemplate{})
}
